package renguanyu.app.auth4fx;

import atlantafx.base.theme.PrimerLight;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import renguanyu.app.auth4fx.util.NotificationUtil;
import renguanyu.app.auth4fx.view.MainView;

public class App extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    public static StackPane rootPane = new StackPane();
    public static MainView mainView = new MainView();
    public static Scene scene;
    @Override
    public void start(Stage primaryStage) {
        rootPane.getChildren().add(mainView);
        scene = new Scene(rootPane, 800, 600);
        scene.getStylesheets().add(new PrimerLight().getUserAgentStylesheet());
        scene.getStylesheets().add(getClass().getResource("/styles.css").toExternalForm());
        primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("/images/king.png")));
        primaryStage.setTitle("Auth4Fx");
        primaryStage.setScene(scene);
        primaryStage.show();
        initGlobalVariable();
    }

    private void initGlobalVariable() {
        NotificationUtil.initObj();
    }

}
